package com.ruoyi.framework.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class ProposalUploadConfig implements WebMvcConfigurer {

    @Value("${proposal.upload.dir}")
    private String proposalUploadDir;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 映射提案图片访问路径
        registry.addResourceHandler("/profile/proposal/**")
                .addResourceLocations("file:" + proposalUploadDir + "/");
    }
}